Optimal. Leaf size=107 \[ -\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{2 \csc ^5(c+d x)}{5 a^2 d}-\frac{4 \csc ^3(c+d x)}{3 a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.173748, antiderivative size = 107, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 8, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.381, Rules used = {3888, 3886, 3473, 8, 2606, 194, 2607, 30} \[ -\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{2 \csc ^5(c+d x)}{5 a^2 d}-\frac{4 \csc ^3(c+d x)}{3 a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3888
Rule 3886
Rule 3473
Rule 8
Rule 2606
Rule 194
Rule 2607
Rule 30
Rubi steps
\begin{align*} \int \frac{\cot ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx &=\frac{\int \cot ^6(c+d x) (-a+a \sec (c+d x))^2 \, dx}{a^4}\\ &=\frac{\int \left (a^2 \cot ^6(c+d x)-2 a^2 \cot ^5(c+d x) \csc (c+d x)+a^2 \cot ^4(c+d x) \csc ^2(c+d x)\right ) \, dx}{a^4}\\ &=\frac{\int \cot ^6(c+d x) \, dx}{a^2}+\frac{\int \cot ^4(c+d x) \csc ^2(c+d x) \, dx}{a^2}-\frac{2 \int \cot ^5(c+d x) \csc (c+d x) \, dx}{a^2}\\ &=-\frac{\cot ^5(c+d x)}{5 a^2 d}-\frac{\int \cot ^4(c+d x) \, dx}{a^2}+\frac{\operatorname{Subst}\left (\int x^4 \, dx,x,-\cot (c+d x)\right )}{a^2 d}+\frac{2 \operatorname{Subst}\left (\int \left (-1+x^2\right )^2 \, dx,x,\csc (c+d x)\right )}{a^2 d}\\ &=\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{\int \cot ^2(c+d x) \, dx}{a^2}+\frac{2 \operatorname{Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,\csc (c+d x)\right )}{a^2 d}\\ &=-\frac{\cot (c+d x)}{a^2 d}+\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{4 \csc ^3(c+d x)}{3 a^2 d}+\frac{2 \csc ^5(c+d x)}{5 a^2 d}-\frac{\int 1 \, dx}{a^2}\\ &=-\frac{x}{a^2}-\frac{\cot (c+d x)}{a^2 d}+\frac{\cot ^3(c+d x)}{3 a^2 d}-\frac{2 \cot ^5(c+d x)}{5 a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{4 \csc ^3(c+d x)}{3 a^2 d}+\frac{2 \csc ^5(c+d x)}{5 a^2 d}\\ \end{align*}
Mathematica [A] time = 1.34006, size = 149, normalized size = 1.39 \[ \frac{\sec ^2(c+d x) \left (-120 d x \cos ^4\left (\frac{1}{2} (c+d x)\right )+3 \tan \left (\frac{1}{2} (c+d x)\right )-31 \tan \left (\frac{c}{2}\right ) \cos ^2\left (\frac{1}{2} (c+d x)\right )-31 \sec \left (\frac{c}{2}\right ) \sin \left (\frac{d x}{2}\right ) \cos \left (\frac{1}{2} (c+d x)\right )+\sin \left (\frac{d x}{2}\right ) \cos ^3\left (\frac{1}{2} (c+d x)\right ) \left (15 \csc \left (\frac{c}{2}\right ) \cot \left (\frac{1}{2} (c+d x)\right )+193 \sec \left (\frac{c}{2}\right )\right )\right )}{30 a^2 d (\sec (c+d x)+1)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.062, size = 94, normalized size = 0.9 \begin{align*}{\frac{1}{40\,d{a}^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{5}}-{\frac{5}{24\,d{a}^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{3}}+{\frac{11}{8\,d{a}^{2}}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }-2\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{d{a}^{2}}}-{\frac{1}{8\,d{a}^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{-1}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.73956, size = 153, normalized size = 1.43 \begin{align*} \frac{\frac{\frac{165 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac{25 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac{3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{2}} - \frac{240 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac{15 \,{\left (\cos \left (d x + c\right ) + 1\right )}}{a^{2} \sin \left (d x + c\right )}}{120 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.10047, size = 277, normalized size = 2.59 \begin{align*} -\frac{26 \, \cos \left (d x + c\right )^{3} + 22 \, \cos \left (d x + c\right )^{2} + 15 \,{\left (d x \cos \left (d x + c\right )^{2} + 2 \, d x \cos \left (d x + c\right ) + d x\right )} \sin \left (d x + c\right ) - 17 \, \cos \left (d x + c\right ) - 16}{15 \,{\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )} \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\cot ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec{\left (c + d x \right )} + 1}\, dx}{a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.39127, size = 113, normalized size = 1.06 \begin{align*} -\frac{\frac{120 \,{\left (d x + c\right )}}{a^{2}} + \frac{15}{a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )} - \frac{3 \, a^{8} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 25 \, a^{8} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 165 \, a^{8} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{a^{10}}}{120 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]